Skip to content

Conversation

@danielkallendorf
Copy link

@danielkallendorf danielkallendorf commented Sep 30, 2025

Matter

Provide a proposed name for the lattice element. This can be an abbreviation, and should be at most 1-2 words (e.g., Quadrupole).

Matter Element (replaces foil)

Materials which fully occupy the beamline, like targets, (stripper-)foils, vacuum windows, gas cells or degraders.
This element can cause energy-loss, angualar and energy straggling, as well as change of charge state or particle type.

MaterialP: Definition of materials

The definition of materials is inspired by Geant4's material handling. One can either use the name, which is the symbol of an element ("G4_Cu", "G4_H", ...) or compound ("G4_STAINLESS-STEEL").
In the future all elements and materials in the G4 Manual will be supported.

Alternatively custom elements can be defined by

ElementP:
- name:      # [string] The name of the material
- density:   # [g/cm^3] The density of the material
- Z:         # [int]    The atomic number
- A:         # [int]    The mass number (equals Z+N)
- N:         # [int]    The neutron number
- m:         # [g/mol]  The atomic mass

and compound by

CompoundP:
- name:      # [string] The name of the material
- density:   # [g/cm^3] The density of the material
- elements:  # List of MaterialP
- ratio:     # List of ratios of the elements

Physical model

I assume a material should be described precise enough by state, density, thickness and composition.

Note: Due to the stochastic nature of beam-matter interaction, the Taylor-/transfer-map-formalism can only account for the mean average effect.

@DavidSagan
Copy link
Member

There are several issues that are raised here. For one there is the matter of units. Do we want to have a consistent set of units which would make densities kg/m^3? I know this looks kind of ugly but from a practical point of view it will lead to less errors.

@DavidSagan
Copy link
Member

Another issue is material naming. For elements and compounds I would use the OpenPMD naming convention #33. And I would get away from the G4_ prefix unless, for a particular material, there is a good reason not to.

@DavidSagan
Copy link
Member

Another issue is that having a single Matter element to represent foils, gas cells, etc. to my mind lumps too many different types of objects under one name. I would rather see separate elements. Especially since the parameter set needed for these different types will undoubtedly be different.

@danielkallendorf
Copy link
Author

Yes. density in kg/m^3 is ugly but reasonable. Do you have a suggestion for the atomic mass?

Is there a list of OpenPMD materials? I could not find any reference on that.

As someone working on fragment separators, to me everything is just matter with composition and shape.
What element specific parameters come to your mind?

@DavidSagan
Copy link
Member

  • You don't need atomic mass directly. EG: #3He is good enough.
  • OpenPMD does not define materials yet. I propose adding to OpenPMD a materials list and then PALS can inherit from that. Much better to have everything is in one place.
  • in terms of element parameters, there could be something like gas pressure that is needed. We should make a survey to see what people need.

Also: Vacuum windows was mentioned. This should definitely be in a category by itself.

@EZoni
Copy link
Member

EZoni commented Oct 6, 2025

@danielkallendorf

There are a few conflicts to be resolved after the latest merge in main. Could you resolve the conflicts and apply the suggestions from @DavidSagan's review? Thanks!

@danielkallendorf
Copy link
Author

Comments from today: define ratios more precise (mass/number of atoms/...)
Allow for Compounds of Compounds or introduce an intermediate element

@danielkallendorf
Copy link
Author

danielkallendorf commented Oct 22, 2025

Updated Version

Matter Element

Materials which fully occupy the beamline, like targets, (stripper-)foils, vacuum windows, gas cells or degraders.
This element can cause energy-loss, angualar and energy straggling, as well as change of charge state or particle type.

Element parameter groups associated with this element kind are:
...

  • MaterialP: Matter parameters.

MaterialP: Definition of materials

MaterialP:
- state:             # ["solid", "liquid", "gas"]
- material:          # [CompoundP,ElementP] definiton of the material in terms of compounds or elements.

The definition of materials is inspired by Geant4's material handling. One can either use the name, which is the symbol of an element ("Cu", "H", ...) or compound ("G4_STAINLESS-STEEL").
In the future all elements and materials in the G4 Manual will be supported, without the G4_-prefix for elements.

Alternatively custom elements can be defined by

ElementP:
- name:      # [string] The name of the material
- density:   # [kg/m^3] The density of the material
- Z:         # [int]    The atomic number
- A:         # [int]    The mass number (equals Z+N)
- N:         # [int]    The neutron number
- m:         # [u]      The atomic mass

and compounds by

CompoundP:
- name:       # [string] The name of the material
- density:    # [kg/m^3] The density of the material
- elements:   # List of MaterialP or CompoundP of which the compound consists
- ratio:      # List of ratios of the elements
- mass_ratio: # List of mass-ratios of the elements

ratio describes the ratio in terms of atom/molecule count, while mass_ratio describes it int terms of mass fractions.
If density is not given it will be inferred form the densities and mass fractions of the elements.

Examples

matter: "Cu" or matter: "G4_STAINLESS-STEEL" or define a new material.

Liquid deuterium can be defined with the ElementP parameters:

ElementP:
- name: "Deuterium(l)"
- density: 160
- Z: 1
- A: 1
- m: 2.01

and deuterated polyethylene (C2H4) can be defined based on the previous definition

CompoundP:
- name: "deutPE"
- density: 1050
- elements:
  - "C"
  - "Deuterium(l)"
- ratio:
  - 2
  - 4

@ax3l ax3l removed the enhancement label Oct 25, 2025
Comment on lines +18 to +22
- density: # [kg/m^3] The density of the material
- Z: # [int] The atomic number
- A: # [int] The mass number (equals Z+N)
- N: # [int] The neutron number
- m: # [u] The atomic mass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not only use the name? Something like #3He is should be sufficient.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like using the #... notation where sensible, so we keep that aspect compatible with openPMD species: https://github.com/openPMD/openPMD-standard/blob/upcoming-2.0.0/EXT_SpeciesType.md

(Material here describes more than what I linked)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will there be conflicts with # as begin-comment marker?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. We should be ok if we define it as a quoted string.

Copy link
Member

@ax3l ax3l Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non-# version is definitely easier to machine read, just more verbose to human write.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidSagan I have a very general question: Is the API which the translator exposes to the interface layer different from what is defined in the PALS standard? Is the PALS standard which we describe here only for the file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First there is the PALS schema which is language agnostic and defines things like parameter names and how to structure the information tree. Then there will be (in development) PALS standards for each language (YAML, etc.) that PALS lattice files can be written in that mirrors the schema. For the translators, what is exposed to the interface layer will be 1) the information in the lattice file and 2) what could be termed "lattice expansion" information which would be things like expression evaluation, floor coordinate evaluation, expanded beam lines, etc.

And yes, what the schema describes is only for the file. The individual translators will document their API. We could talk about trying to have some uniformity between translators but remember the translators will be in different languages so it will not be possible to have a completely uniform API.

Copy link
Member

@ax3l ax3l Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. It is sensible to try to mirror the PALS schema also in APIs, as much as possible/sensible, e.g., when defining properties/function/class names.

Does not prevent to add on top additional helper functions, e.g., to transform, query, convert values between each other, etc.

- name: "Deuterium(l)"
- density: 160
- Z: 1
- A: 1
Copy link
Member

@DavidSagan DavidSagan Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deuterium has A = 2.

Suggested change
- A: 1
- A: 2

@ax3l ax3l added element kinds beamline elements & segments/lines element parameters element parameters (properties, attributes) labels Oct 28, 2025
location: ENTRANCE_END # [enum] Aperture location switch
vertices: [] # [array] Array of vertex points. See below.
material: "" # [string] Material of the Aperture
material: "" # [MaterialP] Material of the Aperture
Copy link
Member

@ax3l ax3l Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is not a string anymore:

Suggested change
material: "" # [MaterialP] Material of the Aperture
material: null # [MaterialP] Material of the Aperture


```{code} yaml
MaterialP:
- state: # ["solid", "liquid", "gas"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have all four states of matter for completeness? :)

Suggested change
- state: # ["solid", "liquid", "gas"]
- state: # ["solid", "liquid", "gas", "plasma"]

Liquid deuterium can be defined with the `ElementP` parameters:
```{code} yaml
ElementP:
- name: "Deuterium(l)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the (l) suffix stand for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"liquid"

MatterP:
- thickness: # [m] Thickness in meter
- area_density: # [kg/m^2] Density times thickness
- MaterialP: # [MatterP or name] the material
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting:

Suggested change
- MaterialP: # [MatterP or name] the material
- MaterialP: # [MatterP or name] the material

Copy link
Member

@ax3l ax3l Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean:

Suggested change
- MaterialP: # [MatterP or name] the material
- material: # [MaterialP] the material

Note that I also removed or name because we should uniformly allow (or disallow) referencing parameter groups by name (currently, we only do this for element kind). Let's keep it simple for now.

- [**ApertureP**](#s:aperture.params): Aperture parameters of the outer (blocking) aperture.
- [**BodyShiftP**](#s:bodyshift.params): Orientation of element with respect to its nominal position.
- [**FloorP**](#s:floor.params): Floor position and orientation.
- [**MetaP**](#s:meta.params): Meta parameters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume adding the MatterP paramter group is the whole idea of this element:

Suggested change
- [**MetaP**](#s:meta.params): Meta parameters.
- [**MatterP**](#s:matter.params): Matter parameters.
- [**MetaP**](#s:meta.params): Meta parameters.

- [**ReferenceP**](#s:ref.params): Reference parameters.
- [**ReferenceChangeP**](#s:refchange.params): Reference energy change and/or reference time correction.
- [**TrackingP**](#s:tracking.params): Tracking parameters.
- [**MaterialP**](#s:material.params): Matter parameters.
Copy link
Member

@ax3l ax3l Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah here it is. Then just alphabetic ordering :)

Suggested change
- [**MaterialP**](#s:material.params): Matter parameters.

I think you mean MatterP, not MaterialP.

@ax3l
Copy link
Member

ax3l commented Oct 28, 2025

This is great! I think I spot a possibility to simplify this a little by using 2 instead of 3 parameter groups, let's discuss tomorrow :)

@danielkallendorf
Copy link
Author

My idea was to separate the material properties MaterialP (what is it made of) from the actual piece of matter MatterP with thickness (and in the future maybe geometry), because MaterialP has probably other applications, like defining the material of the aperture.

@ax3l
Copy link
Member

ax3l commented Oct 29, 2025

Ah, good point.

@DavidSagan
Copy link
Member

DavidSagan commented Nov 5, 2025

@danielkallendorf After thinking it over, to answer your question, I would advocate that things like atomic masses can be output parameters (#107) and one of the aims of the PALS C++ interface I am involved with will be to output this info with the expanded lattice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

element kinds beamline elements & segments/lines element parameters element parameters (properties, attributes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants